package game.roles.bullets;

import game.roles.Role;
import game.utils.ImageChange;

import java.awt.*;

/**
 * @author liuyulai
 * Created with IntelliJ IDEA.
 * Date: 21.5.11
 * Time: 10:03
 * Description: No Description
 */
public class FireBullet extends Role implements EnemyBullet {

    public static Image[] fireBullet;

    private ImageChange rm = new ImageChange(3);

    /**
     * 左上方向
     */
    public static final int LEFT_UP = 0;

    /**
     * 左下方向
     */
    public static final int LEFT_DOWN = 1;

    /**
     * 直线
     */
    public static final int FRONT = 3;

    /**
     * 左上方向
     */
    public static final int LEFT_UP_UP = 3;

    /**
     * 左下方向
     */
    public static final int LEFT_DOWN_DOWN = 4;

    /**
     * 方向初始化
     */
    private int direction;


    public FireBullet(int x, int y, int direction) {
        super(x, y, 40, 40);
        this.direction = direction;
    }

    @Override
    public void rolesMove() {
        this.img = rm.change(fireBullet);
        if (this.direction == LEFT_UP) {
            this.x -= 10;
            this.y -= 4;
        } else if (this.direction == LEFT_DOWN) {
            this.x -= 10;
            this.y += 4;
        } else if (this.direction == LEFT_UP_UP) {
            this.x -= 6;
            this.y -= 4;
        } else if (this.direction == LEFT_DOWN_DOWN) {
            this.x -= 6;
            this.y += 4;
        } else if (this.direction == FRONT) {
            this.x -= 4;
        }
    }
}
